<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRecordRechargesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('record_recharges', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('store_id')->index()->nullable()->comment('门店ID');
            $table->integer('member_id')->index()->nullable()->comment('会员ID');
            $table->integer('price')->index()->default(0)->comment('充值金额');
            $table->integer('type')->index()->default(1)->comment('充值方式:1.开通会员、2.会员充值、3.充值赠送');
            $table->integer('cashier_id')->index()->nullable(0)->comment('收银员ID');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('record_recharges');
    }
}
